
<form action=""   class="layui-form" method="post" style="margin: 20px">
    <!--<div class="layui-form-item">-->
    <div class="layui-form-item">
        <label class="layui-form-label">跳转商品</label>
        <div class="layui-input-inline">
            <select name="goods_id"
                    lay-verify="required" lay-search="">
                <option value=""></option>
                {volist name="goods" id="g"}
                <option {if condition="$info.goods_id==$g.goods_id"} selected="" {/if}  value="{$g.goods_id}">{$g.goods_name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">轮播图</label>
            <div class="layui-input-inline">
                <div class="license_img">
                    <div class="layui-upload-drag">
                        <!--<i class="layui-icon">&#xe67c;</i>-->
                        <p>点击选择图片</p>
                    </div>
                    <div class="upload_img">
                        <img src="{$info.path}" alt="" style="width: 375px;height:175px">
                        <input type="hidden" lay-verify="required" name="path" value="{$info.path}">
                    </div>
                    <br>
                    <!--<span style="color: #666666">图片建议大小：50*50</span>-->
                </div>
            </div>
        </div>
    </div>
    <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="ajax">确定</button>
    </div>
    <!--</div>-->
</form>
<script type="text/javascript">
    layui.use(['element', 'table', 'layer', 'form', 'upload','laydate'], function () {
        var upload = layui.upload;
        var layer = layui.layer;
        upload.render({
            elem: '.license_img'
            , url: '{:url("common/upload")}'
            , done: function (res) {
                if (res.code == 0) {
                    $('.license_img .layui-upload-drag').remove();
                    $('.license_img .upload_img').css('display', 'inline-block');
                    $('.license_img .upload_img img').attr('src', res.data.src);
                    $('.license_img .upload_img input').val(res.data.src);
                } else {
                    var msg = res.msg ? res.msg : "网络错误";
                    layer.msg(msg);
                }
            }
        });
    })
</script>